#ifndef AccountServer_h__
#define AccountServer_h__

#include "Common.h"

#include "JME_TcpSession.h"
#include "JME_NetHandler.h"
#include "JME_Dispatcher.h"
#include "JME_Message.h"
#include "JME_RpcClient.h"
#include "JME_RpcServer.h"

USING_NAMESPACE_JMENGINE;
USING_NAMESPACE_JMENGINE_NET;
USING_NAMESPACE_JMENGINE_GAME;
USING_NAMESPACE_JMENGINE_RPC;

#include "MysqlConnector.h"

class AccountServer
{
public:
	typedef boost::shared_ptr<AccountServer> AccountServerPtr;
public:
	AccountServer();
	~AccountServer();
	static AccountServer::AccountServerPtr getInstance();

	void init();

	MysqlDBPool* getDBPool();
private:
	Json::Value _config;
	size_t _serverId;

	JME_RpcServer::JME_RpcServerPtr _rpcServer;

	MysqlDBPool::DBPoolPtr _dbPool;
};

#endif // AccountServer_h__
